<?php

namespace IDock\Insurance\CHAC\Response;

use IDock\Http\Response;
use IDock\Printer\UploadFilePrinter;

class FUploadFileResponse extends AllCHACResponse
{

    public function resolve(): Response
    {
        $data = $this->getBody();

        $data = urldecode($data);

        $this->result = $data;

        if ($data != '影像上传成功') {
            $this->setError($data);
        }
        return $this;
    }

    public function printerInit(): Response
    {
        $this->printer = new UploadFilePrinter();

        return $this;
    }
}
